package com.guigu.youxuan.controller;

import com.guigu.youxuan.pojo.GoodsComment;
import com.guigu.youxuan.pojo.GoodsInfo;
import com.guigu.youxuan.pojo.dto.GoodsCommentDto;
import com.guigu.youxuan.service.IGoodsCommentService;
import com.guigu.youxuan.service.IGoodsInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author liweixin
 * @since 2024-05-15
 */
@CrossOrigin
@Controller
@RequestMapping("/goodsComment")
public class GoodsCommentController {
    @Autowired
    private IGoodsCommentService iGoodsCommentService;

    @RequestMapping("/selGoodsById/{id}")
    @ResponseBody
    public List<GoodsCommentDto> selgoods(@PathVariable int id){
        List<GoodsCommentDto> commentById = iGoodsCommentService.selGoodsCommentById(id);
        return commentById;
    }
}
